import {ComputedRef} from "vue";
import {IMallPageItem} from "@/api/modules/pointsMall";


export function useMallConfig() {
  const store = useStore()
  const router = useRouter()
  const mallConfig:ComputedRef<IMallPageItem> = computed<IMallPageItem>(() => store.state.pointsMall.mallConfig)

  if (!mallConfig.value.id) {
    console.warn('未知商城，重新选择商城')
    router.replace('/mall/manage/list')
  }

  return {
    mallConfig
  }
}
